package com.darksides.lenditweb.client;

import com.darksides.lenditweb.client.bean.UserBean;
import com.darksides.lenditweb.client.presenter.RootPresenter;
import com.darksides.lenditweb.client.presenter.UserPresenter;
import com.darksides.lenditweb.client.view.RootView;
import com.google.gwt.user.client.ui.Widget;
import com.mvp4g.client.annotation.Event;
import com.mvp4g.client.annotation.Events;
import com.mvp4g.client.annotation.Start;
import com.mvp4g.client.event.EventBus;

/**
 * @author Benjamin Barbier
 *
 */
//start view is the view that will be automatically added to the RootPanel/RootLayoutPanel
@Events( startView = RootView.class )
public interface LenditEventBus extends EventBus {

	//framework will automatically call onUserCreated method of UserDisplayPresenter instance
	//when the event userCreated is fired
//	@Event( handlers = UserDisplayPresenter.class )
//	public void userCreated( UserBean user );

	@Event(  handlers = UserPresenter.class )
	public void userGeted( UserBean user );
	
	@Event(  handlers = UserPresenter.class )
	public void userDeleted( UserBean user );
	
	@Event(  handlers = UserPresenter.class )
	public void userCreated( UserBean user );
	
	@Event( handlers = RootPresenter.class )
	public void changeBody( Widget widget );

	@Event( handlers = RootPresenter.class )
	public void displayMessage( String message );

	@Start
	@Event( handlers = { RootPresenter.class, UserPresenter.class } )
	public void start();

}
